package net.tarine.gastronomi.server.persistence;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

public final class PmFactory {
    private static final PersistenceManagerFactory pmfInstance =
        JDOHelper.getPersistenceManagerFactory("transactions-optional");

    private PmFactory() {
    	pmfInstance.setNontransactionalRead(true);
    	pmfInstance.setDetachAllOnCommit(false); //entities must be available only if db session is open
    }

    public static PersistenceManagerFactory get() {
        return pmfInstance;
    }
}